#ifndef SERIAL_H
#define SERIAL_H

#include <QThread>

class SerialPort : public QThread
{
    Q_OBJECT

signals:
    void signalReadyRead(QByteArray byte);

public:
    explicit SerialPort(QThread *parent = 0);
    ~SerialPort();
    bool openSerial();
    void closeSerial();
    char recvData();
    void sendData(quint8 c);
    void sendString(const QByteArray &ba);

//protected:
    void run();

//private:
    bool m_isExit;
    int usart_fd;
};

#endif // SERIAL_H
